package controllers

import dao._
import javax.inject.Inject
import models.Tables._
import org.joda.time.DateTime
import play.api.libs.json.Json
import play.api.mvc._
import shared.VarTool
import tool.FormTool
import utils.Utils

import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future

/**
 * Created by yz on 21/7/2020
 */
class UserController @Inject()(cc: ControllerComponents)(
  implicit val userDao: UserDao,
  implicit val accountDao: AccountDao
) extends AbstractController(cc) {

  def logout = Action { implicit request =>
    Redirect(routes.AppController.loginBefore()).flashing("info" -> "退出登录成功!", "class" -> Utils.successClass).
      removingFromSession(VarTool.userStr)
  }


}
